<?php
if(isset($_SESSION['s_activeUserId'.$cfgPack]))
{
  $s_activeUserId = $_SESSION['s_activeUserId'.$cfgPack];
	$selectTargate = "SELECT userId,DATE_FORMAT(month,'%Y-%m') AS month,target,achievedTarget 
	                  FROM usertarget
	                  WHERE userId = ".$s_activeUserId." 
	                  AND   month  = '".date("Y-m-01")."' ";
	$selectTargateQuery = mysql_query($selectTargate);
	$selectTargateRes = mysql_fetch_array($selectTargateQuery);
  $balanceTargate = $selectTargateRes['target'] - $selectTargateRes['achievedTarget'];
  if($balanceTargate > 0)
   $balanceShow = "Balance Target: ".$balanceTargate;
  else
    $balanceShow = "";
  $smarty->assign("balanceShow",$balanceShow);
}
?>